package mr.ali.webvideo.mapper;

import mr.ali.webvideo.model.CollectionTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* <p>
    *  Mapper 接口
    * </p>
*
* @author Mr-ali
* @since 2025-08-16
*/
    @Repository
    public interface CollectionTagMapper extends BaseMapper<CollectionTag> {
    /**获取所有的标签*/
    @Select("select * from collection_tag")
    List<CollectionTag> videoNavList();

    /**
     *获取video的标签*/
    @Select(" select * from collection_tag where sort_id IN(select sort_id from collection_tags where video_id = #{id})")
    List<CollectionTag> VideoSortName(@Param("id") Integer id);

    /**获取video的预告片标签*/
    @Select(" select * from collection_tag where sort_id IN(select sort_id from collection_trailer_tags where video_id = #{id})")
    List<CollectionTag>  VideoTrailerSortName(@Param("id") Integer id);

    }
